﻿using Basic.FlowCollect;
using Basic.FlowModel.DB;
using Basic.FlowRemoteModel.NodeAuditEmp;
using Basic.FlowRemoteModel.NodeAuditEmp.Model;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class NodeAuditEmpEvent : IRpcApiService
    {
        private readonly INodeAuditEmpCollect _Service;

        public NodeAuditEmpEvent ( INodeAuditEmpCollect service )
        {
            this._Service = service;
        }
        public NodeAuditEmpDto GetFlowNodeAuditEmp ( GetFlowNodeAuditEmp obj )
        {
            DBFlowNodeAuditEmp dto = this._Service.GetByNodeId<DBFlowNodeAuditEmp>(obj.NodeId);
            return dto.ConvertMap<DBFlowNodeAuditEmp, NodeAuditEmpDto>();
        }
        public bool SetFlowNodeAuditEmp ( SetFlowNodeAuditEmp obj )
        {
            return this._Service.Set(obj.Datum);
        }
    }
}
